package com.asj.house.client;

import com.asj.house.config.feign.HouseIntermediaryFeignConfig;
import com.asj.house.domain.HouseIntermediary;
import com.asj.house.domain.HouseRoom;
import com.asj.house.returns.RespEntity;
import com.asj.house.returns.RespTable;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "houseIntermediaryClient", url = "${manage.url}", configuration = HouseIntermediaryFeignConfig.class)
public interface HouseIntermediaryClient {

    /**
     * 中介信息列表
     * @param page
     * @param limit
     * @return
     */
    @GetMapping("/house-intermediary/list")
    RespTable listHouseIntermediary(@RequestParam(value = "page", required = true) Integer page,
                                    @RequestParam(value = "limit", required = true) Integer limit);

    /**
     * 搜索中介信息
     * @param page
     * @param limit
     * @param name
     * @return
     */
    @GetMapping("/house-intermediary/list")
    RespTable searchHouseIntermediary(@RequestParam("page") Integer page,
                                      @RequestParam("limit") Integer limit,
                                      @RequestParam("name") String name);

    /**
     * 新增中介信息
     * @param houseIntermediary
     * @return
     */
    @PostMapping("/house-intermediary/insert")
    RespEntity insertIntermediary(@RequestBody HouseIntermediary houseIntermediary);

    /**
     * 编辑中介信息
     * @param houseIntermediary
     * @return
     */
    @PutMapping("/house-intermediary/update")
    RespEntity updateIntermediary(@RequestBody HouseIntermediary houseIntermediary);

    /**
     * 删除中介信息
     * @param id
     * @return
     */
    @DeleteMapping("/house-intermediary/delete")
    RespEntity deleteIntermediary(@RequestParam("id") Integer id);

    /**
     * 批量删除房源
     * @param ids
     * @return
     */
    @DeleteMapping("/house-intermediary/deleteBatch")
    RespEntity deleteBatchIntermediary(@RequestParam("ids") Integer[] ids);
}
